#define  _CRT_SECURE_NO_WARNINGS 1
//n&(n-1)一种算法，这个是表达式可以去掉二进制的最右边的1
#include<stdio.h>
int main()
{
	int n, count = 0;
	scanf("%d", &n);
	while (n)
	{
		n = n & (n - 1);
		count++;
	}
	printf("count = %d", count);
	return 0;
}